package com.kin207.netty.message.mqtt.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSONObject;
import com.kin207.netty.server.IServer;
import com.kin207.netty.server.ServerManager;
import com.kin207.netty.session.SessionManager;

public class LockMqttService {
	final static Logger logger = LoggerFactory.getLogger(LockMqttService.class);
	public Integer unlock(JSONObject msg) {
		IServer server = ServerManager.getShared().getServer(msg.getString("sid"));
		SessionManager sm = server.getSessionManager();
		Integer result = sm.sendMessage( msg.getString("cid"), msg.getString("msg"), System.currentTimeMillis());
		logger.error("Topic+JSONObject:"+msg.get("sid")+"++++"+msg);
		return result;
	}
}
